<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script src="./index.js"></script>
    <script>
        function rand(m, n) {
            return Math.ceil(Math.random() * (n - m + 1)) + m - 1;
        }

        let p = new Promise((resolve, reject) => {
            setTimeout(() => {
                // resolve('ok')
                reject('aaa')
            })
        });

        p.then(res => {
            console.log(222);
        }, reason => {
            console.warn(4444);
        })
        console.log(333);
    </script>
</body>

</html>